<template>
  <div>
    <h3>主页</h3>

    <!-- 轮播图 -->

    <mt-swipe :auto="4000">
      <mt-swipe-item v-for="(item,i) in lunbotu" :key="i">
        <img :src="item.img" alt />
      </mt-swipe-item>
    </mt-swipe>

    <!-- 九宫格 -->
    <ul class="mui-table-view mui-grid-view mui-grid-9">
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <router-link to="/home/newsList">
          <img src="../../images/新闻.png" alt />
          <div class="mui-media-body">新闻资讯</div>
        </router-link>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <router-link to="home/photolist">
          <img src="../../images/图.png" alt />

          <div class="mui-media-body">图片分享</div>
        </router-link>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <a href="#">
          <img src="../../images/商城.png" alt />

          <div class="mui-media-body">商品购买</div>
        </a>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <a href="#">
          <img src="../../images/留言.png" alt />

          <div class="mui-media-body">留言反馈</div>
        </a>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <a href="#">
          <img src="../../images/视频.png" alt />

          <div class="mui-media-body">视频专区</div>
        </a>
      </li>
      <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3">
        <a href="#">
          <img src="../../images/联系我们.png" alt />

          <div class="mui-media-body">联系我们</div>
        </a>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      //   lunbotu: ["http://119.3.254.20:3000/public/img/640.png","http://119.3.254.20:3000/public/img/企业微信截图_15865017464958.png","http://119.3.254.20:3000/public/img/u=1120925722,2766582287&fm=26&gp=0.jpg"] //定义轮播图数组
      lunbotu: []
    };
  },
  created() {
    this.getlunbotu();
    console.log(this.lunbotu);
  },
  methods: {
    async getlunbotu() {
      //获取轮播图的方法
      const { data } = await this.$http.get("/getBuildList");
      console.log(data.data);
      if (data.status === 0) {
        this.lunbotu = data.data;
      }
      console.log(this.lunbotu);
    }
  }
};
</script>

<style  scoped>
.mint-swipe {
  height: 180px;
}
.mint-swipe-item:nth-child(1) {
  background-color: red;
}
.mint-swipe-item:nth-child(2) {
  background-color: green;
}
.mint-swipe-item:nth-child(3) {
  background-color: blue;
}
.mint-swipe-item img {
  width: 100%;
  height: 100%;
}

.mui-grid-view li img{
  widows: 50px;
  height: 50px;
}
.mui-grid-view.mui-grid-9{
  background-color: white;
  border:none
}
.mui-grid-view.mui-grid-9 .mui-table-view-cell{
  border:none
}
.mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-body{
  font-size: 13px;
}
</style>